package com.example.lab2.infra.feign;

import com.example.lab2.domain.entity.Job;
import com.example.lab2.infra.feign.fallback.JobFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * eureka server
 * eureka client
 *      service consumer
 *      service provider
 */
@FeignClient(value = "cloud-provider-job", fallback = JobFeignFallback.class)
public interface JobFeign {
    /**
     * 根据JobID 获取JOB信息
     *
     * @param jobId JobId
     * @return
     */
    @GetMapping("/v1/job")
    Job getJobInfoById(@RequestParam(value = "jobId") String jobId);

    @PostMapping("/v1/job/update")
    void updateJob(@RequestBody Job job);




}